package com.ch.personmis.controller;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class PasswordEncoderExample {
    public static void main(String[] args) {
        // 创建BCryptPasswordEncoder实例
        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();

        // 明文密码
        String plainPassword = "admin";

        // 加密密码
        String hashedPassword = passwordEncoder.encode(plainPassword);

        // 输出哈希值
        System.out.println("Hashed Password: " + hashedPassword);
    }
}